package com.baoming.tool;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.baoming.domain.Member;
import com.baoming.util.ServiceTool;

public class LogerTool {
	public static void info(Logger logger , HttpServletRequest request , String msg ){
		Member currentMember = MemberTool.getGlobalMember(request) ; 
		String url = request.getRequestURL().toString() ; 
		String ip = request.getRemoteHost() ; 
		String timeNow = ServiceTool.getNowDate() ; 
		if(currentMember != null){
			logger.info(currentMember.getName() + " , " + msg + " , " + url + " , " + ip + " , " + timeNow) ; 
		}else{
			logger.info("游客  , " + msg + " , " + url + " , " + ip + " , " + timeNow) ; 
		} 
	}
}
